﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace Lesson17_密封_vob
{
    //vob
    //v代表 virtual  虚函数
    //o override 重写
    //b base 父类   根据实际需求保留父类
    //v和o结合使用实现多态
    class GameObject
    {         
        public virtual void Atk()
        {
            Console.WriteLine("游戏对象进行攻击");
        }
    }
    class Player : GameObject
    { 
    public override void Atk()
        {
           
            Console.WriteLine("玩家对象进行攻击");
            base.Atk();
        }
    }
  


    internal class Program
    {
        static void Main(string[] args)
        {
            GameObject  p = new Player();   
            p.Atk();

        }
    }
}
